// ExcessRecordManager.h: interface for the ExcessRecordManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EXCESSRECORDMANAGER_H__C4E635FD_F586_4940_ACBB_5E3D3149E48D__INCLUDED_)
#define AFX_EXCESSRECORDMANAGER_H__C4E635FD_F586_4940_ACBB_5E3D3149E48D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "CommonLib\RecordManager.h"

class ExcessRecordThread;

class ExcessRecordManager : public BaseRecordManager
{
protected:
	ExcessRecordManager();
	virtual ~ExcessRecordManager();

public:
	static ExcessRecordManager * Instance();
	static void DeleteInstance();

	void Init();
	void Cleanup();
	ExcessRecordThread * CreateExcessRecordThread();
	void DestroyExcessRecordThread();

	void AppendExcessRecord(const ExcessRecord& er);
	bool TakeExcessRecord(ExcessRecord& er);

public:
	CEvent m_eventDBInit;

protected:
	ExcessRecordThread * m_pExcessRecordThread;
	CMutex m_mutexRecords;

private:
	static ExcessRecordManager * m_pInstance;
};

#endif // !defined(AFX_EXCESSRECORDMANAGER_H__C4E635FD_F586_4940_ACBB_5E3D3149E48D__INCLUDED_)
